package Practice;
//猜数字小游戏
import java.util.Random;
import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random =new Random();
        int sum = random.nextInt(100);
        System.out.println("作弊"+sum);
        while (true){
            System.out.println("来猜吧");
            int guess = scanner.nextInt();
            if (guess>sum) {
                System.out.println("猜大了");
            } else if (guess<sum) {
                System.out.println("猜小了");
            }else {
                System.out.println("恭喜你猜对了");
                break;
            }
        }
    }
}
